home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / software / vyzkuste / spyware / spyware.exe / Microsoft Baseline Security Analyzer / MBSASetup-EN.msi / Data.Cab / officeadapt.xsl < prev    next >
Extensible Markup Language  |  2004-08-13  |  2KB  |  87 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- 
  3. This converts the office inventory report to mbsa xml format
  4. -->
  5.  
  6. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  7.     version="1.0">
  8.  
  9. <xsl:output method="xml" indent="yes"/>
  10.  
  11. <xsl:param name="UpdateCount" select="count((//ADMINAPPLICABLE|//APPLICABLE)/PATCH[@EXPIRED!='True'])"/>
  12.  
  13. <xsl:template match="PATCH">
  14.     <xsl:param name="grade"/>
  15.     <xsl:param name="baseidneeded" select="@BASELINEIDREQUIRED"/>
  16.  
  17.     <Row>
  18.         <xsl:attribute name="Grade"><xsl:value-of select="$grade"/></xsl:attribute>
  19.         <Col>
  20.             <xsl:attribute name="URL"><xsl:value-of select="@URL"/></xsl:attribute>
  21.             <xsl:if test="@BASELINEIDREQUIRED">
  22.                 <xsl:attribute name="REQUIREDNAME">
  23.                     <xsl:value-of select="(//ADMINAPPLICABLE|//APPLICABLE)/PATCH[@EXPIRED!='True' and @PATCHID=$baseidneeded]/@NAME" />
  24.                 </xsl:attribute>
  25.             </xsl:if>
  26.  
  27.             <xsl:value-of select="@NAME"/>
  28.         </Col>
  29.     </Row>
  30. </xsl:template>
  31.  
  32. <xsl:template match="/">
  33. <Results>
  34.     <Check     ID="174" 
  35.             Grade="--filled in below--"
  36.             Type="5"
  37.             Cat="1"
  38.             Rank="12"
  39.             Name="Office Updates"
  40.             URL1="help/check5311.html"
  41.             URL2="help/check5311fix.html">
  42.  
  43.         <xsl:if test="/INVENTORY/@DETINFOBUILD">
  44.             <xsl:attribute name="DataVersionName">Office update database version:</xsl:attribute>
  45.             <xsl:attribute name="DataVersion">
  46.                 <xsl:value-of select="/INVENTORY/@DETINFOBUILD" />
  47.             </xsl:attribute>
  48.         </xsl:if>
  49.  
  50.         <xsl:if test="$UpdateCount > 0">
  51.  
  52.             <xsl:attribute name="Grade">2</xsl:attribute>
  53.  
  54.             <xsl:if test="$UpdateCount = 1">
  55.                 <Advice>1 update is missing.</Advice>
  56.             </xsl:if>
  57.  
  58.             <xsl:if test="$UpdateCount > 1">
  59.                 <Advice><xsl:value-of select="$UpdateCount"/> updates are missing.</Advice>
  60.             </xsl:if>
  61.  
  62.             <Detail>
  63.                 <Head>
  64.                     <Col>Update</Col>
  65.                 </Head>
  66.  
  67.                 <xsl:apply-templates select="//APPLICABLE/PATCH[@EXPIRED!='True']">
  68.                     <xsl:with-param name="grade">2</xsl:with-param>
  69.                 </xsl:apply-templates>
  70.                 <xsl:apply-templates select="//ADMINAPPLICABLE/PATCH[@EXPIRED!='True']">
  71.                     <xsl:with-param name="grade">6</xsl:with-param>
  72.                 </xsl:apply-templates>
  73.             </Detail>
  74.         </xsl:if>
  75.     
  76.         <xsl:if test="$UpdateCount = 0">
  77.             <xsl:attribute name="Grade">5</xsl:attribute>
  78.  
  79.             <Advice>No critical security updates are missing.</Advice>
  80.         </xsl:if>
  81.  
  82.     </Check>
  83.  
  84. </Results>
  85. </xsl:template>
  86.  
  87. </xsl:stylesheet>